From: kfraser@localhost.localdomain Date: Fri, 31 Aug 2007 10:10:21 +0000 (+0100) Subject: Fix blktap script for versions of readlink command that do not handle X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14987^2~33 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=c0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a;p=xen.git Fix blktap script for versions of readlink command that do not handle regular files. Signed-off-by: Ben Guthro Signed-off-by: Josh Nicholas --- diff --git a/tools/examples/blktap b/tools/examples/blktap index e4ac40b331..b3a0b63544 100644 --- a/tools/examples/blktap +++ b/tools/examples/blktap @@ -69,7 +69,13 @@ then p=${p#*:} fi fi -file=$(readlink -f "$p") || ebusy "$p does not exist." +# some versions of readlink cannot be passed a regular file +if [ -L "$p" ]; then + file=$(readlink -f "$p") || ebusy "$p link does not exist." +else + [ -f "$p" ] || { ebusy "$p file does not exist." } + file="$p" +fi if [ "$mode" != '!' ] then